const joi = require('joi')

// 定义登录验证模块
const userSchema = {
    body: {
        username: joi.string().alphanum().required().min(3).max(12),
        password: joi.string().pattern(/^[\S]{6,15}$/).required()
    }
}

// 定义登录验证模块
const updateSchema = {
    body: {
        username: joi.string().required(),
        nickname: joi.string().required(),
        email: joi.string().email().required()
    }
}

// 定义登录验证模块
const updatePassword = {
    body: {
        oldword: joi.string().pattern(/^[\S]{6,15}$/).required(),
        newword: joi.string().pattern(/^[\S]{6,15}$/).required()
    }
}

module.exports = {
    userSchema,
    updateSchema,
    updatePassword
}